package com.link.play.fit.ai.utils

import com.link.play.fit.ai.bean.BaseResponse
import com.link.play.fit.ai.bean.ByDesFixBean
import com.link.play.fit.ai.bean.CalControlData
import com.link.play.fit.ai.bean.CalControlReqData
import com.link.play.fit.ai.bean.DesBean
import com.link.play.fit.ai.bean.FixByIssueBean
import com.link.play.fit.ai.bean.FoodInfoBean
import com.link.play.fit.ai.bean.ReqCollectFoodData
import com.link.play.fit.ai.bean.ScanFoodBean
import okhttp3.MultipartBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part
import retrofit2.http.Query

interface ApiService {
    /**
     * 扫描食物
     */
    @Multipart
    @POST("api/food/scan")
    suspend fun scan(@Part file: MultipartBody.Part): BaseResponse<ScanFoodBean>
    /**
     * 根据商品码获取信息
     */
    @Multipart
    @POST("api/food/barcode")
    suspend fun barcode(@Part file: MultipartBody.Part): BaseResponse<ScanFoodBean>

    /**
     * 分析食品图片，获取详细营养信息
     */
    @Multipart
    @POST("api/food/label")
    suspend fun label(@Part file: MultipartBody.Part): BaseResponse<ScanFoodBean>
    /**
     * 根据食物的名字获得卡路里
     */
    @GET("api/food/foodInfo")
    suspend fun getFoodInfo(@Query("name") name:String): BaseResponse<List<FoodInfoBean>>

    /**
     * 根据描述 ai 返回食物信息
     */
    @GET("api/food/foodInfoAI")
    suspend fun getFoodInfoAi(@Query("name") name:String ): BaseResponse<FoodInfoBean>

    /**
     * 根据描述修正
     */
    @POST("api/food/fix")
    @Headers("Content-Type: application/json")
    suspend fun byDescribe(@Body request: DesBean): BaseResponse<ByDesFixBean>
    /**
     * 根据json修正
     */
    @POST("api/food/fixByIssue")
    @Headers("Content-Type: application/json")
    suspend fun fixByIssue(@Body request: ReqCollectFoodData): BaseResponse<FixByIssueBean>


    /**
     * 根据运动描述修正
     */
    @POST("api/food/exercise/calories")
    @Headers("Content-Type: application/json")
    suspend fun byExerciseDescribe(@Body request: DesBean): BaseResponse<ByDesFixBean>


    /**
     * AI减肥饮食运动计划接口
     */
    @POST("api/lossWeight/calControl")
    @Headers("Content-Type: application/json")
    suspend fun calControl(@Body request: CalControlReqData): BaseResponse<CalControlData>
}